package com.pig4cloud.common.seate.datasource;

import com.pig4cloud.common.seate.init.SeateRunner;
import io.seata.common.loader.LoadLevel;
import io.seata.core.store.db.AbstractDataSourceGenerator;
import org.springframework.beans.factory.annotation.Autowired;

import javax.sql.DataSource;

/**
 * 自动注入数据源拓展数据源不在局限官方提供方案
 *
 * @author lw
 */
@LoadLevel(name = "auto")
public class AutoDataSourceGenerator extends AbstractDataSourceGenerator {

    @Override
    public DataSource generateDataSource() {
        return SeateRunner.dict.getBean("dataSource");
    }
}
